﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.IO;

namespace Multicasttv_Cleaner
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private static string UserLocalApplicationData = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + @"\MulticastTV";
        private static string AllUserLocalApplicationData = Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + @"\MulticastTV";
        private static string UserApplicationData = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + @"\MulticastTV";

        private void button1_Click(object sender, EventArgs e)
        {
            bool exists = false;
            if (Directory.Exists(UserLocalApplicationData))
            {
                Directory.Delete(UserLocalApplicationData,true);
                exists = true;
            }

            if (Directory.Exists(AllUserLocalApplicationData))
            {
                Directory.Delete(AllUserLocalApplicationData, true);
                exists = true;
            }

            if (Directory.Exists(UserApplicationData))
            {
                Directory.Delete(UserApplicationData, true);
                exists = true;
            }
            if (exists)
                MessageBox.Show(UserLocalApplicationData+ ", " + AllUserLocalApplicationData +", " + UserApplicationData +  " were deleted.");
        }
    }
}
